<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
{eval $user=$this->user; $setting=$this->setting;}
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Manyou's Control Panel</title>
        <meta http-equiv="Content-Type" content="text/html; charset={MY_CHARSET}">
       <link media="all" type="text/css" href="css/common/admin/admincp.css" rel="stylesheet" />
        <script src="js/jquery.js" type="text/javascript"></script>
        <script src="js/admin.js" type="text/javascript"></script>
        <SCRIPT src="js/calendar.js" type="text/javascript"></SCRIPT>
    </head>

    <body>

        <div id="append">
        </div>

        <div class="container">
            <!--{if isset($message)}-->
            <!--{eval $type=isset($type)?$type:'correctmsg'; }-->
            <div class="{$type}"><p>{$message}</p></div>
            <!--{/if}-->
            <h3>礼品列表 <a href="index.php?admin_gift/add{$setting['seo_suffix']}" class="sgbtn">添加礼品</a><a href="index.php?admin_gift/addrange{$setting['seo_suffix']}" class="sgbtn">礼品价格区间</a><a href="index.php?admin_gift/note{$setting['seo_suffix']}" class="sgbtn">礼品公告</a><a href="index.php?admin_gift/log{$setting['seo_suffix']}" class="sgbtn">礼品兑换日志</a></h3>
            <br />
            <div class="hastabmenu">
                <div class="tabcontentcur" id="srchuserdiv">
                    <form action="index.php?admin_gift/logsearch{$setting['seo_suffix']}" method="post">
                        <table width="100%">
                            <tr>
                                <td>价格范围:</td>
                                <td>
                                    <select name="pricerange">
                                        <option value="all">全部</option>
                                        <!--{loop $gift_range $key $val}-->
                                        <option value="{$key}-{$val}">{$key}-{$val}</option>
                                        <!--{/loop}-->
                                    </select>
                                </td>
                                <td>礼品名称:</td>
                                <td colspan="2"><input class="txt" name="giftname"></td>
                            </tr>
                            <tr>
                                <td>兑换用户：</td>
                                <td><input class="txt" name="username"></td>
                                <td>兑换时间:</td>
                                <td><input class="txt" onclick="showcalendar();" name="srchregdatestart">到&nbsp;<input class="txt" onclick="showcalendar();" name="srchregdateend"></td>
                                <td><input class="btn" name="submit" type="submit" value="确定" /></td>
                            </tr>
                        </table>
                    </form>
                </div>
            </div>
            <br>
            <h4>[共 {$giftlognum} 个礼品兑换申请]</h4>
            <div class="mainbox">
                <form name="userForm" action="index.php?admin_gift/remove{$setting['seo_suffix']}" method="post">
                    <table class="datalist fixwidth" >
                        <tr>
                            <th><input class="checkbox" id="chkall" onclick="checkall('gid[]')" type="checkbox" name="chkall"><label for="chkall">全选</label></th>
                            <th>礼品名称</th>
                            <th>用户名</th>
                            <th>真名</th>
                            <th>地址</th>
                            <th>邮编</th>
                            <th>电话</th>
                            <th>QQ</th>
                            <th>Email</th>
                            <th>备注</th>
                            <th>兑换时间</th>
                            <th>状态</th>
                        </tr>
				{loop $loglist $log}
                        <tr>
                            <td class="option"><input class="checkbox" type="checkbox" value="{$log['id']}" name="id[]"></td>
                            <td><strong>{$log['giftname']}</strong></td>
                            <td>{$log['username']}</td>
                            <td>{$log['realname']}</td>
                            <td>{$log['address']}</td>
                            <td>{$log['postcode']}</td>
                            <td>{$log['phone']}</td>
                            <td>{$log['qq']}</td>
                            <td>{$log['email']}</td>
                            <td>{$log['notes']}</td>
                            <td>{$log['time']}</td>
                            <td>{if !$log['status']}<font color="Red">等待兑换...</font>{else}<font color="green">已送出</font>{/if}</td>
                        </tr>
				{/loop}
                        <tr class="nobg">
                            <td colspan="7" class="tdpage"><div class="pages">{$departstr}</div></td>
                        </tr>
                        <tr class="nobg">
                            <td colspan="7"><input class="btn" type="button" name="available" onclick="onavailable(1);" value="设为已寄送" /></td>
                        </tr>

                    </table>
                </form>
            </div>
        </div>
    </body>
    <script type="text/javascript">
        function onavailable(type){
            if($("input[name='id[]']:checked").length == 0){
                alert('你没有选择任何礼品记录！');
                return false;
            }
            document.userForm.action="index.php?admin_gift/send/"+type+"{$setting['seo_suffix']}";
            document.userForm.submit();
        }
    </script>
</html>
